package com.roadjava.convert.demo05;

import com.roadjava.beans.dto.CarDTO;
import com.roadjava.beans.vo.CarVO;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper
public abstract class CarConvert05 {

    public static CarConvert05 INSTANCE = Mappers.getMapper(CarConvert05.class);

    @Mapping(source = "brand", target = "brandName")
    public abstract CarVO dto2vo(CarDTO carDTO);

    @InheritConfiguration
    @Mapping(target = "id", ignore = true)
    public abstract void updateCarVO(CarDTO carDTO, @MappingTarget CarVO carVO);

}